home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / ConditionalMacros.p < prev    next >
Text File  |  1996-05-01  |  9KB  |  234 lines

  1. {
  2.      File:        ConditionalMacros.p
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.0dx
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ConditionalMacros;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CONDITIONALMACROS__}
  28. {$SETC __CONDITIONALMACROS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ConditionalMacrosIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {
  35. ***************************************************************************************************
  36.     UNIVERSAL_INTERFACES_VERSION
  37.     
  38.         0x0300 => version 3.0
  39.         0x0210 => version 2.1
  40.         This conditional did not exist prior to version 2.1
  41. ***************************************************************************************************
  42. }
  43. {$SETC UNIVERSAL_INTERFACES_VERSION := $0300}
  44. {
  45. ***************************************************************************************************
  46.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  47.     GENERATING68K            - Compiler is generating 68k family instructions
  48.  
  49.         Invariant:
  50.             GENERATINGPOWERPC != GENERATING68K
  51. ***************************************************************************************************
  52. }
  53. {$IFC UNDEFINED LSPWRP }
  54. {$SETC LSPWRP := 0 }
  55. {$ENDC}
  56. {$IFC UNDEFINED LSP68K }
  57. {$SETC LSP68K := NOT LSPWRP }
  58. {$ENDC}
  59. {$IFC UNDEFINED GENERATINGPOWERPC }
  60. {$SETC GENERATINGPOWERPC := LSPWRP }
  61. {$ENDC}
  62. {$IFC UNDEFINED GENERATING68K }
  63. {$SETC GENERATING68K := LSP68K }
  64. {$ENDC}
  65. {
  66. ***************************************************************************************************
  67.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  68.     
  69.         Invariant:
  70.             GENERATING68881 => GENERATING68K
  71. ***************************************************************************************************
  72. }
  73. {$IFC GENERATING68K AND OPTION(mc68881) }
  74. {$SETC GENERATING68881 := 1 }
  75. {$ENDC}
  76. {$IFC UNDEFINED GENERATING68881 }
  77. {$SETC GENERATING68881 := 0 }
  78. {$ENDC}
  79. {
  80. ***************************************************************************************************
  81.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  82.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  83.  
  84.         Invariants:
  85.             GENERATINGPOWERPC => GENERATINGCFM
  86.             GENERATINGPOWERPC => CFMSYSTEMCALLS
  87.             CFMSYSTEMCALLS => GENERATINGCFM
  88. ***************************************************************************************************
  89. }
  90. {$SETC GENERATINGCFM := GENERATINGPOWERPC }
  91. {$SETC CFMSYSTEMCALLS := GENERATINGPOWERPC }
  92. {
  93. ***************************************************************************************************
  94.     One or none of the following BUILDING_~= conditionals is expected to be set during 
  95.     compilation (e.g. MrC -d BUILDING_FOR_SYSTEM7), the others should be left undefined.
  96.     If none is set, BUILDING_FOR_SYSTEM7_AND_SYSTEM8 is used.
  97.     
  98.         BUILDING_FOR_SYSTEM7                - Code is intended to run on System 7.x machine or earlier .
  99.         BUILDING_FOR_SYSTEM7_AND_SYSTEM8    - Code is intended to run on System 7 or Copland.
  100.         BUILDING_FOR_SYSTEM8                - Code is intended to run on Copland only.
  101.         BUILDING_PREEMPTIVE_CODE            - Code is intended to run as Copland server or driver.
  102.         
  103.     The following conditionals are set up based on which of the BUILDING_~= flag (above) was specified.
  104.     They are used in throughout the interface files to conditionalize declarations.
  105.     
  106.         FOR_SYSTEM7_ONLY                    - In System 7. Not in Copland.
  107.         FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED    - In System 7. Works in Copland, but there is a better way.
  108.         FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE    - In System 7. In Copland, but only for cooperative tasks.
  109.         FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE    - In System 7. In Copland.
  110.         FOR_SYSTEM8_COOPERATIVE                - Not in System 7.  In Copland, but only for cooperative tasks.
  111.         FOR_SYSTEM8_PREEMPTIVE                - Not in System 7.  In Copland.
  112.         
  113.         FOR_OPAQUE_SYSTEM_DATA_STRUCTURES    - Always true for system 8, but can be set by developer to
  114.                                               true or false for System 7.  When true, the contents of 
  115.                                               many system data structures are removed from the interfaces.
  116.                                               In the future, the Mac OS will have fewer data structures 
  117.                                               shared between applications and the system.  The problem
  118.                                               with shared data is 1) the system has to poll the data
  119.                                               to detect changes made by an application, 2) it prevents
  120.                                               data structures from being changed in the future.
  121.                                               Procedural interface will be used instead.
  122.                                               
  123.         FOR_PTR_BASED_AE                    - This is a temporary fix for Copland DR1.  It is needed to
  124.                                               distinguish between pointer based and handle based AppleEvents.
  125.                                               If you are in the case of BUILDING_FOR_SYSTEM7_AND_SYSTEM8
  126.                                               and want to use new pointer base AppleEvents, you will need to
  127.                                               -d FOR_PTR_BASED_AE on your compiler command line.
  128.         
  129. ***************************************************************************************************
  130. }
  131. {$IFC 0 }
  132. {  extra if statement is to work around a bug in PPCAsm 1.2a2  }
  133. {$ELSEC}
  134. {$IFC NOT UNDEFINED BUILDING_FOR_SYSTEM7 }
  135. {$IFC UNDEFINED FOR_OPAQUE_SYSTEM_DATA_STRUCTURES }
  136. {$SETC FOR_OPAQUE_SYSTEM_DATA_STRUCTURES := 0 }
  137. {$ENDC}
  138. {$SETC FOR_PTR_BASED_AE := 0 }
  139. {$SETC FOR_SYSTEM7_ONLY := 1 }
  140. {$SETC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED := 1 }
  141. {$SETC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE := 1 }
  142. {$SETC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE := 1 }
  143. {$SETC FOR_SYSTEM8_COOPERATIVE := 0 }
  144. {$SETC FOR_SYSTEM8_PREEMPTIVE := 0 }
  145. {$ELSEC}
  146. {$IFC NOT UNDEFINED BUILDING_FOR_SYSTEM7_AND_SYSTEM8 }
  147. {$IFC UNDEFINED FOR_OPAQUE_SYSTEM_DATA_STRUCTURES }
  148. {$SETC FOR_OPAQUE_SYSTEM_DATA_STRUCTURES := 1 }
  149. {$ENDC}
  150. {$IFC UNDEFINED FOR_PTR_BASED_AE }
  151. {$SETC FOR_PTR_BASED_AE := 0 }
  152. {$ENDC}
  153. {$SETC FOR_SYSTEM7_ONLY := 0 }
  154. {$SETC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED := 1 }
  155. {$SETC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE := 1 }
  156. {$SETC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE := 1 }
  157. {$SETC FOR_SYSTEM8_COOPERATIVE := 1 }
  158. {$SETC FOR_SYSTEM8_PREEMPTIVE := 1 }
  159. {$ELSEC}
  160. {$IFC NOT UNDEFINED BUILDING_FOR_SYSTEM8 }
  161. {$SETC FOR_OPAQUE_SYSTEM_DATA_STRUCTURES := 1 }
  162. {$SETC FOR_PTR_BASED_AE := 1 }
  163. {$SETC FOR_SYSTEM7_ONLY := 0 }
  164. {$SETC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED := 0 }
  165. {$SETC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE := 1 }
  166. {$SETC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE := 1 }
  167. {$SETC FOR_SYSTEM8_COOPERATIVE := 1 }
  168. {$SETC FOR_SYSTEM8_PREEMPTIVE := 1 }
  169. {$ELSEC}
  170. {$IFC NOT UNDEFINED BUILDING_PREEMPTIVE_CODE }
  171. {$SETC FOR_OPAQUE_SYSTEM_DATA_STRUCTURES := 1 }
  172. {$SETC FOR_PTR_BASED_AE := 1 }
  173. {$SETC FOR_SYSTEM7_ONLY := 0 }
  174. {$SETC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED := 0 }
  175. {$SETC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE := 0 }
  176. {$SETC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE := 1 }
  177. {$SETC FOR_SYSTEM8_COOPERATIVE := 0 }
  178. {$SETC FOR_SYSTEM8_PREEMPTIVE := 1 }
  179. {$ELSEC}
  180. {  default is BUILDING_FOR_SYSTEM7_AND_SYSTEM8   }
  181. {$SETC FOR_OPAQUE_SYSTEM_DATA_STRUCTURES := 1 }
  182. {$IFC UNDEFINED FOR_PTR_BASED_AE }
  183. {$SETC FOR_PTR_BASED_AE := 0 }
  184. {$ENDC}
  185. {$SETC FOR_SYSTEM7_ONLY := 0 }
  186. {$SETC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED := 1 }
  187. {$SETC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE := 1 }
  188. {$SETC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE := 1 }
  189. {$SETC FOR_SYSTEM8_COOPERATIVE := 1 }
  190. {$SETC FOR_SYSTEM8_PREEMPTIVE := 1 }
  191. {$ENDC}
  192. {$ENDC}
  193. {$ENDC}
  194. {$ENDC}
  195. {$ENDC}
  196. {
  197. ***************************************************************************************************
  198.  
  199.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  200.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  201.                               are now more sensitive to change because CFM binds by name.  In the 
  202.                               past, system routine names were compiled out to just an A-Trap.  
  203.                               Macros have been added that each map an old name to its new name.  
  204.                               This allows old routine names to be used in existing source files,
  205.                               but the macros only work if OLDROUTINENAMES is true.  This support
  206.                               will be removed in the near future.  Thus, all source code should 
  207.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  208.                               to see if your code has any old names left in it.
  209.     
  210.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  211.                               has been moved from Strings to TextUtils.  It is conditionalized in
  212.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  213.                               This allows developers to upgrade to newer interface files without suddenly
  214.                               all their code not compiling becuase of "incorrect" includes.  But, it
  215.                               allows the slow migration of system calls to more understandable file
  216.                               locations.  OLDROUTINELOCATIONS currently defaults to true, but eventually
  217.                               will default to false.
  218.  
  219. ***************************************************************************************************
  220. }
  221. {$IFC UNDEFINED OLDROUTINENAMES }
  222. {$SETC OLDROUTINENAMES := 0 }
  223. {$ENDC}
  224. {$IFC UNDEFINED OLDROUTINELOCATIONS }
  225. {$SETC OLDROUTINELOCATIONS := 0 }
  226. {$ENDC}
  227. {$SETC UsingIncludes := ConditionalMacrosIncludes}
  228.  
  229. {$ENDC} {__CONDITIONALMACROS__}
  230.  
  231. {$IFC NOT UsingIncludes}
  232.  END.
  233. {$ENDC}
  234.